#ifndef HOFFMANTREENODE_H
#define HOFFMANTREENODE_H

#include <QList>
#include <QQueue>

class HoffmanTreeNode
{
public:
    HoffmanTreeNode();
    void addLeft(HoffmanTreeNode* left);
    void addRight(HoffmanTreeNode* right);
    QString nodeNames();
    int nodeWeightSum();
    HoffmanTreeNode* getLeft()
    {
        return left;
    }
    HoffmanTreeNode* getRight()
    {
        return right;
    }

    QString getNodeName() const;
    void setNodeName(const QString &newNodeName);

    int getWeight() const;
    void setWeight(int newWeight);

private:
    HoffmanTreeNode* left, * right;
    QString nodeName;
    QList<HoffmanTreeNode> getAllSubNodes();
    int weight;
};
namespace HoffmanTreeByGoldfish
{
    // class HoffmanTreeNode;
    QList<HoffmanTreeNode*> generateNodes(int argc,  char** argv);
    void reduce(QList<HoffmanTreeNode*>& nodes);
    void argError(int i,  char* argv);
};

#endif // HOFFMANTREENODE_H
